package com.sright.bcard.user.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.user.dal.dao.VisitorListDAO;
import com.sright.bcard.user.dal.entity.VisitorListDO;
import com.sright.bcard.user.dal.entity.ext.VisitorRelationEXTDO;
import com.sright.bcard.user.dal.mapper.VisitorListMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Repository
public class VisitorListDAOImpl extends BaseDAOImpl<VisitorListDO> implements VisitorListDAO {

    @Resource
    private VisitorListMapper visitorListMapper;

    @Override
    public Integer deleteByPrimaryKey(Long id) {
        return visitorListMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<VisitorListDO> selectByEnterpriseIdAndSourceIdNotZero(Long enterpriseId) {
        return visitorListMapper.selectByEnterpriseIdAndSourceIdNotZero(enterpriseId);
    }

    @Override
    public List<VisitorListDO> selectByEnterpriseId(Long enterpriseId) {
        return visitorListMapper.selectByEnterpriseId(enterpriseId);
    }

    @Override
    public List<VisitorListDO> selectByEnterpriseIdBwtDate(Long enterpriseId, Date beginDate, Date endDate) {
        return visitorListMapper.selectByEnterpriseIdBwtDate(enterpriseId, beginDate, endDate);
    }

    @Override
    public List<VisitorListDO> selectByEnterpriseIdAndMemberIdBeforeDate(Long enterpriseId, Long visitorMemberId, Date beginDate) {
        return visitorListMapper.selectByEnterpriseIdAndMemberIdBeforeDate(enterpriseId, visitorMemberId, beginDate);
    }

    @Override
    public List<VisitorListDO> selectByVisitorId(Long visitorId) {
        return visitorListMapper.selectByVisitorId(visitorId);
    }

    @Override
    public Integer selectSumTimeByVisitorId(Long visitorId) {
        return visitorListMapper.selectSumTimeByVisitorId(visitorId);
    }

    @Override
    public List<VisitorListDO> selectAllByVisitorId(Long visitorId) {
        return visitorListMapper.selectAllByVisitorId(visitorId);
    }

    @Override
    public List<VisitorRelationEXTDO> selectByMemberId(Long visitorMemberId) {
        return visitorListMapper.selectByMemberId(visitorMemberId);
    }

    @Override
    public List<VisitorRelationEXTDO> selectByUserId(List<Long> visitorUserId) {
        return visitorListMapper.selectByUserId(visitorUserId);
    }

    @Override
    public List<VisitorListDO> selectByUserIdAndData(Long userId, Date beginTime, Date endTime, Long memberId) {
        return visitorListMapper.selectByUserIdAndData(userId,beginTime,endTime,memberId);
    }

    @Override
    protected BaseMapper<VisitorListDO> getObjMapper() {
        return visitorListMapper;
    }
}
